<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" href="css/index.css">
		<script src="js/vue.js"></script>
		<script src="js/axios.min.js"></script>
		<script src="js/elementui.js"></script>
	</head>
	<body>
		<div id="app">
			<el-button @click="getdata" type="primay">获取后端数据</el-button>
			<br />
			{{val}}
		</div>
	</body>

	<script>
		new Vue({
			el: "#app",
			data: {
				val: '...'
			},
			methods: {
				getdata() {
					axios.get("http://localhost:8080/userlogin").then(function(res) {
						console.log(res);
						console.log(res.data);
						this.val = res.data;
					}).catch(err => {
						console.log(err)
					});
				}
			}
		})
	</script>

</html>